<h2>Artículos</h2>
<p id="page-intro">Administración</p>

<!-- Begin Opciones -->
<ul class="shortcut-buttons-set">

    <li>
        <a class="shortcut-button" href="/admin/post/add">
            <span>
                <img src="/resources/images/icons/add_article_48.png" alt="icon" /><br />
                Agregar Artículo
            </span>
        </a>
    </li>
    <li>
        <a class="shortcut-button" href="/admin/post/search">
            <span>
                <img src="/resources/images/icons/search_article_48.png" alt="icon" /><br />
                Buscar Artículo
            </span>
        </a>
    </li>
</ul>
<!-- END Opciones -->

<div class="clear"></div> <!-- End .clear -->
<!-- BEGIN Success-->
<?php echo $this->partial('partials/success.phtml', 'admin', array('success' => $this->success)); ?>
<!-- END Success -->
<!-- BEGIN Success-->
<?php echo $this->partial('partials/error.phtml', 'admin', array('errors' => $this->errors)); ?>
<!-- END Success -->

<div class="content-box">

    <div class="content-box-header">
        <h3>Artículos</h3>
    </div>



    <div class="content-box-content">

        <div class="tab-content default-tab" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
            <?php if (count($this->posts) > 0){ ?>
            <table>

                <thead>
                    <tr>
                        <th>Id</th>
                        <th>Título</th>
                        <th>Usuario</th>
                        <th>Categoría</th>
                        <th>Operaciones</th>
                    </tr>

                </thead>

                <tfoot>
                    <tr>
                        <td colspan="6">

                            <!-- BEGIN Pagination -->
                            <?php if (isset($this->paginator))
                                echo $this->partial('partials/pagination.phtml', 'admin', array('paginator' => $this->paginator, 'url' => $this->urlPagination)); ?>
                            <!-- END Pagination -->

                            <div class="clear"></div>
                        </td>
                    </tr>
                </tfoot>

                <tbody>

                    <?php if (count($this->posts) > 0) {
                                foreach ($this->posts as $post) { ?>

                                    <tr>
                                        <td><?php echo $post['postid'] ?></td>
                                        <td><?php echo $post['title'] ?></td>
                                        <td><?php echo $post['username'] .'( '.$post['userid'].' )' ?></td>
                                        <td><?php echo $post['categoryname'] .'( '.$post['categoryid'].' )' ?></td>
                                        <td>
                                            <!-- Icons -->
                                            <a href="/admin/post/edit/post/<?php echo $post['postid']; ?>" title="Edit"><img src="/resources/admin/images/icons/pencil.png" alt="Edit" /></a>
                                            <a href="/admin/post/delete/post/<?php echo $post['postid']; ?>" title="Delete" class="ask"><img src="/resources/admin/images/icons/cross.png" alt="Delete" /></a>
                                        </td>
                                    </tr>
                    <?php }
                            } else { ?>
                                <tr>
                                    <td colspan="7">
                                        <!-- attention -->
<?php echo $this->partial('partials/attention.phtml', 'admin', array('attention' => $this->attention)); ?>
                                <!-- attention -->
                            </td>
                        </tr>
<?php } ?>
                </tbody>


            </table>
<?php } else{ ?>

            <strong>No hay artículos (-_-)...</strong>
        <?php }    ?>

        </div> <!-- End #tab1 -->



    </div> <!-- End .content-box-content -->
</div>